package com.weixing.mall.provider.model.vo;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.weixing.mall.base.constant.DatePattern;
import com.weixing.mall.base.constant.GlobalConstant;
import com.weixing.mall.base.enums.WhetherEnum;
import com.weixing.mall.core.enums.OrderAppTagEnum;
import com.weixing.mall.core.enums.OrderSysTagEnum;
import com.weixing.mall.provider.api.model.enums.OrderTypeEnum;
import com.weixing.mall.provider.api.model.enums.SettleStateEnum;
import com.weixing.mall.provider.model.enums.*;
import com.weixing.mall.provider.support.excel.EnumConverter.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;

/**
 * 客服审核订单列表vo
 *
 * @author  wx
 * @since  v1.0
 */
@Data
public class KefuAuditOrderExcelVo {


    @ApiModelProperty(value = "商品图片")
    @ExcelIgnore
    private String productImg;
    @ExcelProperty("商品图片")
    @ColumnWidth(10)
    private URL goodsImgUrl;

    public void setProductImg(String productImg) {
        this.productImg = productImg;
        try {
            if (StrUtil.isNotEmpty(productImg)){
                this.goodsImgUrl=new URL(GlobalConstant.IMG_PATH_URL+productImg+GlobalConstant.IMG_PATH_URL_SUFFIX);
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }

    @ApiModelProperty(value = "货号")
    @ExcelProperty("货号")
    private String goodsSn;

    @ApiModelProperty(value = "款号")
    @ExcelProperty("款号")
    private String styleNo;

    @ApiModelProperty(value = "颜色")
    @ExcelProperty("颜色")
    private String color;

    @ApiModelProperty(value = "尺码")
    @ExcelProperty("尺码")
    private String size;

    @ApiModelProperty(value = "支付流水号")
    @ExcelProperty("支付流水号")
    private String outTradeNo;

    @ApiModelProperty(value = "订单号")
    @ExcelProperty("订单号")
    private String orderSn;

    @ApiModelProperty(value = "吊牌价")
    @ExcelProperty("吊牌价")
    private BigDecimal marketPrice;

    @ApiModelProperty(value = "订单金额")
    @ExcelProperty("订单金额")
    private BigDecimal orderPrice;

    @ApiModelProperty(value = "收货人信息")
    @ExcelProperty("收货人信息")
    private String contactUser;

    @ApiModelProperty(value = "收货人手机号")
    @ExcelProperty("收货人手机号")
    private String contactPhone;

    @ApiModelProperty(value = "收获地址")
    @ExcelProperty("收获地址")
    private String addrDetails;

    @ApiModelProperty(value = "是否支付")
    @ExcelProperty(value="是否支付", converter = WhetherEnumConverter.class)
    private WhetherEnum isPay;

    @ApiModelProperty(value = "标签状态")
    @ExcelProperty(value = "标签状态", converter = OrderSysTagConverter.class)
    private OrderSysTagEnum sysTag;

    @ApiModelProperty(value = "认领状态")
    @ExcelProperty(value = "认领状态", converter = OrderIsClaimConverter.class)
    private OrderIsClaimEnum isClaim;

    @ApiModelProperty(value = "是否换货")
    @ExcelProperty(value = "是否换货", converter = IsRepeatConverter.class)
    private Integer afterSaleTag;

    @ApiModelProperty(value = "商品名称")
    @ExcelProperty("商品名称")
    private String goodsName;

    @ApiModelProperty(value = "活动名称")
    @ExcelProperty("活动名称")
    private String actName;

    @ApiModelProperty(value = "下单人")
    @ExcelProperty("下单人")
    private String buyer;

    @ApiModelProperty(value = "四级代理")
    @ExcelIgnore
    @ExcelProperty("四级代理")
    private String level4thName;

    @ApiModelProperty(value = "三级代理")
    @ExcelProperty("三级代理")
    private String level3rdName;

    @ApiModelProperty(value = "二级代理")
    @ExcelProperty("二级代理")
    private String level2ndName;

    @ApiModelProperty(value = "一级代理")
    @ExcelProperty("一级代理")
    private String level1stName;

    @ApiModelProperty(value = "经销商")
    @ExcelProperty("经销商")
    private String distributorName;

    @ApiModelProperty(value = "客服")
    @ExcelProperty("客服")
    private String customerName;

    @ApiModelProperty(value = "发货员")
    @ExcelProperty("发货员")
    private String shipperName;

    @ApiModelProperty(value = "快递公司")
    @ExcelProperty("快递公司")
    private String expressName;

    @ApiModelProperty(value = "快递单号")
    @ExcelProperty("快递单号")
    private String expressSn;

    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "下单时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("下单时间")
    private Date createdTime;

    @ApiModelProperty(value = "客服审核时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("客服审核时间")
    private Date auditTime;

    @ApiModelProperty(value = "发货时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("发货时间")
    private Date shipTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("更新时间")
    private Date updatedTime;


}
